package com.wsj.web.form.admin;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.upload.FormFile;

public class ImgActionFrom extends ActionForm {
	
	
	private static final long serialVersionUID = -6384993868124304516L;
	
	private FormFile path;
    private String desc ;
    
    
    
	@Override
	public void reset(ActionMapping arg0, HttpServletRequest arg1) {
		// TODO Auto-generated method stub
		desc = "" ;
	}

	@Override
	public ActionErrors validate(ActionMapping arg0, HttpServletRequest arg1) {
		// TODO Auto-generated method stub
		ActionErrors actionErr = new ActionErrors();
		if(desc.equals(""))actionErr.add("desc",new ActionMessage("desc"));
		return actionErr;
	}

	public FormFile getPath() {
		return path;
	}

	public void setPath(FormFile path) {
		this.path = path;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

}
